package com.kexin.service;

import com.kexin.mappers.data2.TItemdetailvMapper;
import com.kexin.pojo.TItemdetailv;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

@Service
public class TItmedetailVService {
    @Autowired
    private TItemdetailvMapper tItemdetailvMapper;

    public void insertInfo(TItemdetailv tItemdetailvKey) {
        tItemdetailvMapper.insertSelective(tItemdetailvKey);


    }

    public List<TItemdetailv> getInfo(Integer fitemid) {
        Example example =new Example(TItemdetailv.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("fitemid",fitemid);
        return tItemdetailvMapper.selectByExample(example);
    }

    public List<TItemdetailv> getInfoSort(int i) {
        Example example =new Example(TItemdetailv.class);
        example.setOrderByClause("fdetailid DESC");
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("fitemclassid",i);
        return tItemdetailvMapper.selectByExample(example);
    }
}
